package com.larissa.android.note;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;

import java.util.ArrayList;
import java.util.List;

public class NoteListViewModel extends ViewModel {
    private static final String TAG="NoteListViewModel";
    private NoteRepository noteRepository;
//    List<Note> mNotes=new ArrayList<>();
    LiveData<List<Note>>notesLiveData;

    public NoteListViewModel(){
//        for(int i=0;i<50;i++){
//            Note note=new Note();
//            note.setTitle(String.format("Note No.%s",i));
//            if(i%2==0)
//                note.setNoteLog("Created");
//            else
//                note.setNoteLog("Modified");
//            note.setContent(String.format("This is the content of Note No.%s",i));
//            mNotes.add(note);
//        }
        noteRepository=NoteRepository.getInstance();
        notesLiveData= noteRepository.getAllNotes();

    }
}
